package com.lkd.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lkd.entity.TaskEntity;
import com.lkd.entity.TaskStatusTypeEntity;
import com.lkd.http.vo.CancelTaskViewModel;
import com.lkd.http.vo.TaskViewModel;
import com.lkd.vo.Pager;
import org.bouncycastle.util.Longs;

import java.util.List;

/**
 * 工单业务逻辑
 */
public interface TaskService extends IService<TaskEntity> {


    /**
     * 通过条件搜索工单列表
     * @param pageIndex
     * @param pageSize
     * @param innerCode
     * @param userId
     * @param taskCode
     * @param isRepair 是否是运维工单
     * @return
     */
    Pager<TaskEntity> search(Long pageIndex, Long pageSize, String innerCode, Integer userId, String taskCode, Integer status, Boolean isRepair, String start, String end);





    /**
     * 获取所有状态类型
     * @return
     */
    List<TaskStatusTypeEntity> getAllStatus();


    //新建工单
    Boolean addTask(TaskViewModel taskViewModel);

    //接收工单
    boolean acceptTask(String taskId);

    //取消工单
    boolean cancelTask(String taskId, CancelTaskViewModel cancelTaskViewModel);

    //完成工单
    boolean completeTask(Long id);

    /**
     *
     * @param reginId  区域id
     * @param isRepair  是否是运维人员
     * @return
     */
    int getLeastUser(Long reginId,boolean isRepair);

}
